import data.Dictionary
import kotlinx.serialization.encodeToString
import kotlinx.serialization.json.Json
import java.io.File

fun main() {
    val list = File("converter/data/custom_phrase_dict_data.txt").readLines().map {
        with(it.split("    ")) {
            Dictionary(
                name = this[0],
                keyWord = it.replace(" ",""),
                paste = this[1]
            )
        }
    }
    File("converter/out/custom_phrase_dict_data.json").apply {
        delete()
        parentFile.mkdirs()
        createNewFile()
    }.writeText(Json.encodeToString(list))
}